home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / emacs.lha / emacs-19.16 / info / vip-1 (.txt) < prev    next >
GNU Info File  |  1993-06-17  |  50KB  |  1,000 lines

  1. This is Info file ../info/vip, produced by Makeinfo-1.55 from the input
  2. file vip.texinfo.
  3. Distribution
  4. ************
  5.    Copyright (C) 1987 Masahiko Sato.
  6.    Permission is granted to make and distribute verbatim copies of this
  7. manual provided the copyright notice and this permission notice are
  8. preserved on all copies.
  9.    Permission is granted to copy and distribute modified versions of
  10. this manual under the conditions for verbatim copying, provided that
  11. the entire resulting derived work is distributed under the terms of a
  12. permission notice identical to this one.
  13.    Permission is granted to copy and distribute translations of this
  14. manual into another language, under the same conditions as for modified
  15. versions.
  16. File: vip,  Node: Top,  Next: Survey,  Up: (DIR)
  17.    VIP ***
  18.    VIP is a Vi emulating package written in Emacs Lisp.  VIP implements
  19. most Vi commands including Ex commands.  It is therefore hoped that
  20. this package will enable you to do Vi style editing under the powerful
  21. GNU Emacs environment.  This info file describes the usage of VIP
  22. assuming that you are fairly accustomed to Vi but not so much with
  23. Emacs.  Also we will concentrate mainly on differences from Vi,
  24. especially features unique to VIP.
  25.    It is recommended that you read nodes on survey and on customization
  26. before you start using VIP.  Other nodes may be visited as needed.
  27.    Comments and bug reports are welcome.  Please send messages to
  28. `ms@Sail.Stanford.Edu' if you are outside of Japan and to
  29. `masahiko@sato.riec.tohoku.junet' if you are in Japan.
  30. * Menu:
  31. * Survey::        A survey of VIP.
  32. * Vi Commands::        Details of Vi commands.
  33. * Ex Commands::        Details of Ex commands.
  34. * Customization::    How to customize VIP.
  35. File: vip,  Node: Survey,  Next: Basic Concepts,  Prev: Top,  Up: Top
  36. A Survey of VIP
  37. ***************
  38.    In this chapter we describe basics of VIP with emphasis on the
  39. features not found in Vi and on how to use VIP under GNU Emacs.
  40. * Menu:
  41. * Basic Concepts::    Basic concepts in Emacs.
  42. * Loading VIP::        How to load VIP automatically.
  43. * Modes in VIP::    VIP has three modes, which are orthogonal to modes
  44.             in Emacs.
  45. * Differences from Vi:: Differences of VIP from Vi is explained.
  46. File: vip,  Node: Basic Concepts,  Next: Loading VIP,  Prev: Survey,  Up: Survey
  47. Basic Concepts
  48. ==============
  49.    We begin by explaining some basic concepts of Emacs.  These concepts
  50. are explained in more detail in the GNU Emacs Manual.
  51.    Conceptually, a "buffer" is just a string of ASCII characters and two
  52. special characters PNT ("point") and MRK ("mark") such that the
  53. character PNT occurs exactly once and MRK occurs at most once.  The
  54. "text" of a buffer is obtained by deleting the occurrences of PNT and
  55. MRK.  If, in a buffer, there is a character following PNT then we say
  56. that point is "looking at" the character; otherwise we say that point
  57. is "at the end of buffer".  PNT and MRK are used to indicate positions
  58. in a buffer and they are not part of the text of the buffer.  If a
  59. buffer contains a MRK then the text between MRK and PNT is called the
  60. "region" of the buffer.
  61.    Emacs provides (multiple) "windows" on the screen, and you can see
  62. the content of a buffer through the window associated with the buffer.
  63. The cursor of the screen is always positioned on the character after
  64.    A "keymap" is a table that records the bindings between characters
  65. and command functions.  There is the "global keymap" common to all the
  66. buffers.  Each buffer has its "local keymap" that determines the "mode"
  67. of the buffer.  Local keymap overrides global keymap, so that if a
  68. function is bound to some key in the local keymap then that function
  69. will be executed when you type the key.  If no function is bound to a
  70. key in the local map, however, the function bound to the key in the
  71. global map becomes in effect.
  72. File: vip,  Node: Loading VIP,  Next: Modes in VIP,  Prev: Basic Concepts,  Up: Survey
  73. Loading VIP
  74. ===========
  75.    The recommended way to load VIP automatically is to include the line:
  76.      (load "vip")
  77. in your `.emacs' file.  The `.emacs' file is placed in your home
  78. directory and it will be executed every time you invoke Emacs.  If you
  79. wish to be in vi mode whenever Emacs starts up, you can include the
  80. following line in your `.emacs' file instead of the above line:
  81.      (setq term-setup-hook 'vip-mode)
  82. (*Note Vi Mode::, for the explanation of vi mode.)
  83.    Even if your `.emacs' file does not contain any of the above lines,
  84. you can load VIP and enter vi mode by typing the following from within
  85. Emacs.
  86.      M-x vip-mode
  87. File: vip,  Node: Modes in VIP,  Next: Emacs Mode,  Prev: Loading VIP,  Up: Survey
  88. Modes in VIP
  89. ============
  90. Loading VIP has the effect of globally binding `C-z' (`Control-z') to
  91. the function `vip-change-mode-to-vi'. The default binding of `C-z' in
  92. GNU Emacs is `suspend-emacs', but, you can also call `suspend-emacs' by
  93. typing `C-x C-z'.  Other than this, all the key bindings of Emacs
  94. remain the same after loading VIP.
  95.    Now, if you hit `C-z', the function `vip-change-mode-to-vi' will be
  96. called and you will be in "vi mode".  (Some major modes may locally bind
  97. `C-z' to some special functions.  In such cases, you can call
  98. `vip-change-mode-to-vi' by `execute-extended-command' which is invoked
  99. by `M-x'.  Here `M-x' means `Meta-x', and if your terminal does not
  100. have a META key you can enter it by typing `ESC x'.  The same effect
  101. can also be achieve by typing `M-x vip-mode'.)
  102.    You can observe the change of mode by looking at the "mode line".
  103. For instance, if the mode line is:
  104.      -----Emacs: *scratch*              (Lisp Interaction)----All------------
  105. then it will change to:
  106.      -----Vi:    *scratch*              (Lisp Interaction)----All------------
  107. Thus the word `Emacs' in the mode line will change to `Vi'.
  108.    You can go back to the original "emacs mode" by typing `C-z' in vi
  109. mode.  Thus `C-z' toggles between these two modes.
  110.    Note that modes in VIP exist orthogonally to modes in Emacs.  This
  111. means that you can be in vi mode and at the same time, say, shell mode.
  112.    Vi mode corresponds to Vi's command mode.  From vi mode you can enter
  113. "insert mode" (which corresponds to Vi's insert mode) by usual Vi
  114. command keys like `i', `a', `o' ... etc.
  115.    In insert mode, the mode line will look like this:
  116.      -----Insert *scratch*              (Lisp Interaction)----All------------
  117. You can exit from insert mode by hitting ESC key as you do in Vi.
  118.    That VIP has three modes may seem very complicated, but in fact it
  119. is not so.  VIP is implemented so that you can do most editing
  120. remaining only in the two modes for Vi (that is vi mode and insert
  121. mode).
  122.    The figure below shows the transition of three modes in VIP.
  123.                 === C-z ==>          == i,o ... ==>
  124.      emacs mode             vi mode                 insert mode
  125.                 <== X-z ===          <=== ESC ====
  126. * Menu:
  127. * Emacs Mode::        This is the mode you should know better.
  128. * Vi Mode::        Vi commands are executed in this mode.
  129. * Insert Mode::        You can enter text, and also can do editing if you
  130.             know enough Emacs commands.
  131. File: vip,  Node: Emacs Mode,  Next: Vi Mode,  Prev: Modes in VIP,  Up: Modes in VIP
  132. Emacs Mode
  133. ----------
  134.    You will be in this mode just after you loaded VIP.  You can do all
  135. normal Emacs editing in this mode.  Note that the key `C-z' is globally
  136. bound to `vip-change-mode-to-vi'.  So, if you type `C-z' in this mode
  137. then you will be in vi mode.
  138. File: vip,  Node: Vi Mode,  Next: Insert Mode,  Prev: Emacs Mode,  Up: Modes in VIP
  139. Vi Mode
  140. -------
  141.    This mode corresponds to Vi's command mode.  Most Vi commands work
  142. as they do in Vi.  You can go back to emacs mode by typing `C-z'.  You
  143. can enter insert mode, just as in Vi, by typing `i', `a' etc.
  144. File: vip,  Node: Insert Mode,  Next: Differences from Vi,  Prev: Vi Mode,  Up: Modes in VIP
  145. Insert Mode
  146. -----------
  147.    The key bindings in this mode is the same as in the emacs mode
  148. except for the following 4 keys.  So, you can move around in the buffer
  149. and change its content while you are in insert mode.
  150. `ESC'
  151.      This key will take you back to vi mode.
  152. `C-h'
  153.      Delete previous character.
  154. `C-w'
  155.      Delete previous word.
  156. `C-z'
  157.      Typing this key has the same effect as typing ESC in emacs mode.
  158.      Thus typing `C-z x' in insert mode will have the same effect as
  159.      typing `ESC x' in emacs mode.
  160. File: vip,  Node: Differences from Vi,  Next: Undoing,  Prev: Insert Mode,  Up: Survey
  161. Differences from Vi
  162. ===================
  163.    The major differences from Vi are explained below.
  164. * Menu:
  165. * Undoing::        You can undo more in VIP.
  166. * Changing::        Commands for changing the text.
  167. * Searching::        Search commands.
  168. * z Command::        You can now use zH, zM and zL as well as z- etc.
  169. * Counts::        Some Vi commands which do not accept a count now
  170.             accept one.
  171. * Marking::        You can now mark the current point, beginning of
  172.             the buffer etc.
  173. * Region Commands::    You can now give a region as an argument for delete
  174.             commands etc.
  175. * New Commands::    Some new commands not available in Vi are added.
  176. * New Bindings::    Bindings of some keys are changed for the
  177.             convenience of editing under Emacs.
  178. * Window Commands::    Commands for moving among windows etc.
  179. * Buffer Commands::    Commands for selecting buffers etc.
  180. * File Commands::    Commands for visiting files etc.
  181. * Misc Commands::    Other useful commands.
  182. File: vip,  Node: Undoing,  Next: Changing,  Prev: Differences from Vi,  Up: Differences from Vi
  183. Undoing
  184. -------
  185.    You can repeat undoing by the `.' key.  So, `u' will undo a single
  186. change, while `u . . .', for instance, will undo 4 previous changes.
  187. Undo is undoable as in Vi.  So the content of the buffer will be the
  188. same before and after `u u'.
  189. File: vip,  Node: Changing,  Next: Searching,  Prev: Undoing,  Up: Differences from Vi
  190. Changing
  191. --------
  192.    Some commands which change a small number of characters are executed
  193. slightly differently.  Thus, if point is at the beginning of a word
  194. `foo' and you wished to change it to `bar' by typing `c w', then VIP
  195. will prompt you for a new word in the minibuffer by the prompt `foo =>
  196. '.  You can then enter `bar' followed by RET or ESC to complete the
  197. command.  Before you enter RET or ESC you can abort the command by
  198. typing `C-g'.  In general, you can abort a partially formed command by
  199. typing `C-g'.
  200. File: vip,  Node: Searching,  Next: z Command,  Prev: Changing,  Up: Differences from Vi
  201. Searching
  202. ---------
  203.    As in Vi, searching is done by `/' and `?'.  The string will be
  204. searched literally by default.  To invoke a regular expression search,
  205. first execute the search command `/' (or `?') with empty search string.
  206. (I.e, type `/' followed by RET.) A search for empty string will toggle
  207. the search mode between vanilla search and regular expression search.
  208. You cannot give an offset to the search string.  (It is a limitation.)
  209. By default, search will wrap around the buffer as in Vi.  You can
  210. change this by rebinding the variable `vip-search-wrap-around'.  *Note
  211. Customization::, for how to do this.
  212. File: vip,  Node: z Command,  Next: Counts,  Prev: Searching,  Up: Differences from Vi
  213. z Command
  214. ---------
  215.    For those of you who cannot remember which of `z' followed by RET,
  216. `.' and `-' do what.  You can also use `z' followed by `H', `M' and `L'
  217. to place the current line in the Home (Middle, and Last) line of the
  218. window.
  219. File: vip,  Node: Counts,  Next: Marking,  Prev: z Command,  Up: Differences from Vi
  220. Counts
  221. ------
  222.    Some Vi commands which do not accept a count now accept one
  223.      Given counts, text will be yanked (in Vi's sense) that many times.
  224.      Thus `3 p' is the same as `p p p'.
  225.      Given counts, that many copies of text will be inserted. Thus `o a
  226.      b c ESC' will insert 3 lines of `abc' below the current line.
  227.      Given a count N, N-th occurrence will be searched.
  228. File: vip,  Node: Marking,  Next: Region Commands,  Prev: Counts,  Up: Differences from Vi
  229. Marking
  230. -------
  231.    Typing an `m' followed by a lower case character CH marks the point
  232. to the register named CH as in Vi.  In addition to these, we have
  233. following key bindings for marking.
  234. `m <'
  235.      Set mark at the beginning of buffer.
  236. `m >'
  237.      Set mark at the end of buffer.
  238. `m .'
  239.      Set mark at point (and push old mark on mark ring).
  240. `m ,'
  241.      Jump to mark (and pop mark off the mark ring).
  242. File: vip,  Node: Region Commands,  Next: New Commands,  Prev: Marking,  Up: Differences from Vi
  243. Region Commands
  244. ---------------
  245.    Vi operators like `d', `c' etc. are usually used in combination with
  246. motion commands.  It is now possible to use current region as the
  247. argument to these operators.  (A "region" is a part of buffer delimited
  248. by point and mark.)  The key `r' is used for this purpose.  Thus `d r'
  249. will delete the current region.  If `R' is used instead of `r' the
  250. region will first be enlarged so that it will become the smallest
  251. region containing the original region and consisting of whole lines.
  252. Thus `m . d R' will have the same effect as `d d'.
  253. File: vip,  Node: New Commands,  Next: New Bindings,  Prev: Region Commands,  Up: Differences from Vi
  254. Some New Commands
  255. -----------------
  256.    Note that the keys below (except for `R') are not used in Vi.
  257. `C-a'
  258.      Move point to the beginning of line.
  259. `C-n'
  260.      If you have two or more windows in the screen, this key will move
  261.      point to the next window.
  262. `C-o'
  263.      Insert a newline and leave point before it, and then enter insert
  264.      mode.
  265. `C-r'
  266.      Backward incremental search.
  267. `C-s'
  268.      Forward incremental search.
  269. `C-c'
  270. `C-x'
  271. `ESC'
  272.      These keys will exit from vi mode and return to emacs mode
  273.      temporarily.  If you hit one of these keys, Emacs will be in emacs
  274.      mode and will believe that you hit that key in emacs mode. For
  275.      example, if you hit `C-x' followed by `2', then the current window
  276.      will be split into 2 and you will be in vi mode again.
  277.      Escape to emacs mode.  Hitting `\' will take you to emacs mode,
  278.      and you can execute a single Emacs command.  After executing the
  279.      Emacs command you will be in vi mode again.  You can give a count
  280.      before typing `\'.  Thus `5 \ *', as well as `\ C-u 5 *', will
  281.      insert `*****' before point.  Similarly `1 0 \ C-p' will move the
  282.      point 10 lines above the current line.
  283.      Kill current buffer if it is not modified.  Useful when you
  284.      selected a buffer which you did not want.
  285.      `Q' is for query replace and `R' is for replace.  By default,
  286.      string to be replaced are treated literally.  If you wish to do a
  287.      regular expression replace, first do replace with empty string as
  288.      the string to be replaced.  In this way, you can toggle between
  289.      vanilla and regular expression replacement.
  290.      These keys are used to Visit files.  `v' will switch to a buffer
  291.      visiting file whose name can be entered in the minibuffer. `V' is
  292.      similar, but will use window different from the current window.
  293.      If followed by a certain character CH, it becomes an operator whose
  294.      argument is the region determined by the motion command that
  295.      follows.  Currently, CH can be one of `c', `C', `g', `q' and `s'.
  296. `# c'
  297.      Change upper case characters in the region to lower case
  298.      (`downcase-region').
  299. `# C'
  300.      Change lower case characters in the region to upper case. For
  301.      instance, `# C 3 w' will capitalize 3 words from the current point
  302.      (`upcase-region').
  303. `# g'
  304.      Execute last keyboard macro for each line in the region
  305.      (`vip-global-execute').
  306. `# q'
  307.      Insert specified string at the beginning of each line in the region
  308.      (`vip-quote-region').
  309. `# s'
  310.      Check spelling of words in the region (`spell-region').
  311.      Call last keyboard macro.
  312. File: vip,  Node: New Bindings,  Next: Window Commands,  Prev: New Commands,  Up: Differences from Vi
  313. New Key Bindings
  314. ----------------
  315.    In VIP the meanings of some keys are entirely different from Vi.
  316. These key bindings are done deliberately in the hope that editing under
  317. Emacs will become easier.  It is however possible to rebind these keys
  318. to functions which behave similarly as in Vi.  *Note Customizing Key
  319. Bindings::, for details.
  320. `C-g'
  321.      In Vi, `C-g' is used to get information about the file associated
  322.      to the current buffer.  Here, `g' will do that, and `C-g' is used
  323.      to abort a command (this is for compatibility with emacs mode.)
  324. `SPC'
  325. `RET'
  326.      Now these keys will scroll up and down the text of current window.
  327.      Convenient for viewing the text.
  328.      They are used to switch to a specified buffer.  Useful for
  329.      switching to already existing buffer since buffer name completion
  330.      is provided.  Also a default buffer will be given as part of the
  331.      prompt, to which you can switch by just typing RET key.  `s' is
  332.      used to select buffer in the current window, while `S' selects
  333.      buffer in another window.
  334.      These keys will exit from vi mode and return to emacs mode
  335.      temporarily.  If you type `C' (`X'), Emacs will be in emacs mode
  336.      and will believe that you have typed `C-c' (`C-x', resp.) in emacs
  337.      mode. Moreover, if the following character you type is an upper
  338.      case letter, then Emacs will believe that you have typed the
  339.      corresponding control character.  You will be in vi mode again
  340.      after the command is executed.  For example, typing `X S' in vi
  341.      mode is the same as typing `C-x C-s' in emacs mode.  You get the
  342.      same effect by typing `C-x C-s' in vi mode, but the idea here is
  343.      that you can execute useful Emacs commands without typing control
  344.      characters. For example, if you hit `X' (or `C-x') followed by
  345.      `2', then the current window will be split into 2 and you will be
  346.      in vi mode again.
  347.    In addition to these, `ctl-x-map' is slightly modified:
  348. `X 3'
  349. `C-x 3'
  350.      This is equivalent to `C-x 1 C-x 2' (1 + 2 = 3).
  351. File: vip,  Node: Window Commands,  Next: Buffer Commands,  Prev: New Bindings,  Up: Differences from Vi
  352. Window Commands
  353. ---------------
  354.    In this and following subsections, we give a summary of key bindings
  355. for basic functions related to windows, buffers and files.
  356. `C-n'
  357.      Switch to next window.
  358. `X 1'
  359. `C-x 1'
  360.      Delete other windows.
  361. `X 2'
  362. `C-x 2'
  363.      Split current window into two windows.
  364. `X 3'
  365. `C-x 3'
  366.      Show current buffer in two windows.
  367. File: vip,  Node: Buffer Commands,  Next: File Commands,  Prev: Window Commands,  Up: Differences from Vi
  368. Buffer Commands
  369. ---------------
  370.      Switch to the specified buffer in the current window
  371.      (`vip-switch-to-buffer').
  372.      Switch to the specified buffer in another window
  373.      (`vip-switch-to-buffer-other-window').
  374.      Kill the current buffer if it is not modified.
  375. `X S'
  376. `C-x C-s'
  377.      Save the current buffer in the file associated to the buffer.
  378. File: vip,  Node: File Commands,  Next: Misc Commands,  Prev: Buffer Commands,  Up: Differences from Vi
  379. File Commands
  380. -------------
  381.      Visit specified file in the current window.
  382.      Visit specified file in another window.
  383. `X W'
  384. `C-x C-w'
  385.      Write current buffer into the specified file.
  386. `X I'
  387. `C-x C-i'
  388.      Insert specified file at point.
  389. File: vip,  Node: Misc Commands,  Next: Vi Commands,  Prev: File Commands,  Up: Differences from Vi
  390. Miscellaneous Commands
  391. ----------------------
  392. `X ('
  393. `C-x ('
  394.      Start remembering keyboard macro.
  395. `X )'
  396. `C-x )'
  397.      Finish remembering keyboard macro.
  398.      Call last remembered keyboard macro.
  399. `X Z'
  400. `C-x C-z'
  401.      Suspend Emacs.
  402. `Z Z'
  403.      Exit Emacs.
  404.      Query replace.
  405.      Replace.
  406. File: vip,  Node: Vi Commands,  Next: Numeric Arguments,  Prev: Misc Commands,  Up: Top
  407. Vi Commands
  408. ***********
  409.    This chapter describes Vi commands other than Ex commands
  410. implemented in VIP.  Except for the last section which discusses insert
  411. mode, all the commands described in this chapter are to be used in vi
  412. mode.
  413. * Menu:
  414. * Numeric Arguments::    Many commands accept numeric arguments
  415. * Important Keys::    Some very important keys.
  416. * Buffers and Windows::    Commands for handling buffers and windows.
  417. * Files::        Commands for handling files.
  418. * Viewing the Buffer::    How you can view the current buffer.
  419. * Mark Commands::    Marking positions in a buffer.
  420. * Motion Commands::    Commands for moving point.
  421. * Searching and Replacing::    Commands for searching and replacing.
  422. * Modifying Commands::    Commands for modifying the buffer.
  423. * Other Vi Commands::    Miscellaneous Commands.
  424. * Commands in Insert Mode::    Commands for entering insert mode.
  425. File: vip,  Node: Numeric Arguments,  Next: Important Keys,  Prev: Vi Commands,  Up: Vi Commands
  426. Numeric Arguments
  427. =================
  428.    Most Vi commands accept a "numeric argument" which can be supplied as
  429. a prefix to the commands.  A numeric argument is also called a "count".
  430. In many cases, if a count is given, the command is executed that many
  431. times.  For instance, `5 d d' deletes 5 lines while simple `d d'
  432. deletes a line.  In this manual the metavariable N will denote a count.
  433. File: vip,  Node: Important Keys,  Next: Buffers and Windows,  Prev: Numeric Arguments,  Up: Vi Commands
  434. Important Keys
  435. ==============
  436.    The keys `C-g' and `C-l' are unique in that their associated
  437. functions are the same in any of emacs, vi and insert mode.
  438. `C-g'
  439.      Quit.  Cancel running or partially typed command (`keyboard-quit').
  440. `C-l'
  441.      Clear the screen and reprint everything (`recenter').
  442.    In Emacs many commands are bound to the key strokes that start with
  443. `C-x', `C-c' and ESC.  These commands can be accessed from vi mode as
  444. easily as from emacs mode.
  445. `C-x'
  446. `C-c'
  447. `ESC'
  448.      Typing one of these keys have the same effect as typing it in
  449.      emacs mode.  Appropriate command will be executed according as the
  450.      keys you type after it.  You will be in vi mode again after the
  451.      execution of the command.  For instance, if you type `ESC <' (in
  452.      vi mode) then the cursor will move to the beginning of the buffer
  453.      and you will still be in vi mode.
  454.      Typing one of these keys have the effect of typing the
  455.      corresponding control character in emacs mode.  Moreover, if you
  456.      type an upper case character following it, that character will
  457.      also be translated to the corresponding control character.  Thus
  458.      typing `X W' in vi mode is the same as typing `C-x C-w' in emacs
  459.      mode.  You will be in vi mode again after the execution of a
  460.      command.
  461.      Escape to emacs mode.  Hitting the `\' key will take you to emacs
  462.      mode, and you can execute a single Emacs command.  After executing
  463.      the Emacs command you will be in vi mode again.  You can give a
  464.      count before typing `\'.  Thus `5 \ +', as well as `\ C-u 5 +',
  465.      will insert `+++++' before point.
  466. File: vip,  Node: Buffers and Windows,  Next: Files,  Prev: Important Keys,  Up: Vi Commands
  467. Buffers and Windows
  468. ===================
  469.    In Emacs the text you edit is stored in a "buffer".  See GNU Emacs
  470. Manual, for details.  There is always one "selected" buffer which is
  471. called the "current buffer".
  472.    You can see the contents of buffers through "windows" created by
  473. Emacs.  When you have multiple windows on the screen only one of them
  474. is selected.  Each buffer has a unique name, and each window has a mode
  475. line which shows the name of the buffer associated with the window and
  476. other information about the status of the buffer.  You can change the
  477. format of the mode line, but normally if you see `**' at the beginning
  478. of a mode line it means that the buffer is "modified".  If you write
  479. out the content of the buffer to a file, then the buffer will become
  480. not modified.  Also if you see `%%' at the beginning of the mode line,
  481. it means that the file associated with the buffer is write protected.
  482.    We have the following commands related to windows and buffers.
  483. `C-n'
  484.      Move cursor to the next-window (`vip-next-window').
  485. `X 1'
  486.      Delete other windows and make the selected window fill the screen
  487.      (`delete-other-windows').
  488. `X 2'
  489.      Split current window into two windows (`split-window-vertically').
  490. `X 3'
  491.      Show current buffer in two windows.
  492. `s BUFFER RET'
  493.      Select or create a buffer named BUFFER (`vip-switch-to-buffer').
  494. `S BUFFER RET'
  495.      Similar but select a buffer named BUFFER in another window
  496.      (`vip-switch-to-buffer-other-window').
  497.      Kill the current buffer if it is not modified or if it is not
  498.      associated with a file
  499.      (`vip-kill-buffer').
  500. `X B'
  501.      List the existing buffers (`list-buffers').
  502.    As "buffer name completion" is provided, you have only to type in
  503. initial substring of the buffer name which is sufficient to identify it
  504. among names of existing buffers.  After that, if you hit TAB the rest
  505. of the buffer name will be supplied by the system, and you can confirm
  506. it by RET.  The default buffer name to switch to will also be prompted,
  507. and you can select it by giving a simple RET.  See GNU Emacs Manual for
  508. details of completion.
  509. File: vip,  Node: Files,  Next: Viewing the Buffer,  Prev: Buffers and Windows,  Up: Vi Commands
  510. Files
  511. =====
  512.    We have the following commands related to files.  They are used to
  513. visit, save and insert files.
  514. `v FILE RET'
  515.      Visit specified file in the current window (`vip-find-file').
  516. `V FILE RET'
  517.      Visit specified file in another window
  518.      (`vip-find-file-other-window').
  519. `X S'
  520.      Save current buffer to the file associated with the buffer.  If no
  521.      file is associated with the buffer, the name of the file to write
  522.      out the content of the buffer will be asked in the minibuffer.
  523. `X W FILE RET'
  524.      Write current buffer into a specified file.
  525. `X I FILE RET'
  526.      Insert a specified file at point.
  527.      Give information on the file associated with the current buffer.
  528.      Tell you the name of the file associated with the buffer, the line
  529.      number of the current point and total line numbers in the buffer.
  530.      If no file is associated with the buffer, this fact will be
  531.      indicated by the null file name `""'.
  532.    In Emacs, you can edit a file by "visiting" it.  If you wish to
  533. visit a file in the current window, you can just type `v'.  Emacs
  534. maintains the "default directory" which is specific to each buffer.
  535. Suppose, for instance, that the default directory of the current buffer
  536. is `/usr/masahiko/lisp/'.  Then you will get the following prompt in the
  537. minibuffer.
  538.      visit file: /usr/masahiko/lisp/
  539. If you wish to visit, say, `vip.el' in this directory, then you can
  540. just type `vip.el' followed by RET.  If the file `vip.el' already
  541. exists in the directory, Emacs will visit that file, and if not, the
  542. file will be created.  Emacs will use the file name (`vip.el', in this
  543. case) as the name of the buffer visiting the file.  In order to make
  544. the buffer name unique, Emacs may append `<2>', `<3>' etc., to the
  545. buffer name.  As the "file name completion" is provided here, you can
  546. sometime save typing.  For instance, suppose there is only one file in
  547. the default directory whose name starts with `v', that is `vip.el'.
  548. Then if you just type `v TAB' then it will be completed to `vip.el'.
  549. Thus, in this case, you just have to type `v v TAB RET' to visit
  550. `/usr/masahiko/lisp/vip.el'.  Continuing the example, let us now
  551. suppose that you wished to visit the file
  552. `/usr/masahiko/man/vip.texinfo'.  Then to the same prompt which you get
  553. after you typed `v', you can enter `/usr/masahiko/man/vip.texinfo' or
  554. `../man/vip.texinfo' followed by RET.
  555.    Use `V' instead of `v', if you wish to visit a file in another
  556. window.
  557.    You can verify which file you are editing by typing `g'.  (You can
  558. also type `X B' to get nformation on other buffers too.)  If you type
  559. `g' you will get an information like below in the echo area:
  560.      "/usr/masahiko/man/vip.texinfo" line 921 of 1949
  561.    After you edited the buffer (`vip.texinfo', in our example) for a
  562. while, you may wish to save it in a file.  If you wish to save it in
  563. the file associated with the buffer (`/usr/masahiko/man/vip.texinfo',
  564. in this case), you can just say `X S'.  If you wish to save it in
  565. another file, you can type `X W'.  You will then get a similar prompt
  566. as you get for `v', to which you can enter the file name.
  567. File: vip,  Node: Viewing the Buffer,  Next: Mark Commands,  Prev: Files,  Up: Vi Commands
  568. Viewing the Buffer
  569. ==================
  570.    In this and next section we discuss commands for moving around in the
  571. buffer.  These command do not change the content of the buffer.  The
  572. following commands are useful for viewing the content of the current
  573. buffer.
  574. `SPC'
  575. `C-f'
  576.      Scroll text of current window upward almost full screen.  You can
  577.      go forward in the buffer by this command (`vip-scroll').
  578. `RET'
  579. `C-b'
  580.      Scroll text of current window downward almost full screen.  You
  581.      can go backward in the buffer by this command (`vip-scroll-back').
  582. `C-d'
  583.      Scroll text of current window upward half screen.  You can go down
  584.      in the buffer by this command (`vip-scroll-down').
  585. `C-u'
  586.      Scroll text of current window downward half screen.  You can go up
  587.      in the buffer by this command (`vip-scroll-up').
  588. `C-y'
  589.      Scroll text of current window upward by one line
  590.      (`vip-scroll-down-one').
  591. `C-e'
  592.      Scroll text of current window downward by one line
  593.      (`vip-scroll-up-one').
  594. You can repeat these commands by giving a count.  Thus, `2 SPC' has the
  595. same effect as `SPC SPC'.
  596.    The following commands reposition point in the window.
  597. `z H'
  598. `z RET'
  599.      Put point on the top (home) line in the window.  So the current
  600.      line becomes the top line in the window.  Given a count N, point
  601.      will be placed in the N-th line from top (`vip-line-to-top').
  602. `z M'
  603. `z .'
  604.      Put point on the middle line in the window.  Given a count N,
  605.      point will be placed in the N-th line from the middle line
  606.      (`vip-line-to-middle').
  607. `z L'
  608. `z -'
  609.      Put point on the bottom line in the window.  Given a count N,
  610.      point will be placed in the N-th line from bottom
  611.      (`vip-line-to-bottom').
  612. `C-l'
  613.      Center point in window and redisplay screen (`recenter').
  614. File: vip,  Node: Mark Commands,  Next: Motion Commands,  Prev: Viewing the Buffer,  Up: Vi Commands
  615. Mark Commands
  616. =============
  617.    The following commands are used to mark positions in the buffer.
  618. `m CH'
  619.      Store current point in the register CH.  CH must be a lower case
  620.      character between `a' and `z'.
  621. `m <'
  622.      Set mark at the beginning of current buffer.
  623. `m >'
  624.      Set mark at the end of current buffer.
  625. `m .'
  626.      Set mark at point.
  627. `m ,'
  628.      Jump to mark (and pop mark off the mark ring).
  629.    Emacs uses the "mark ring" to store marked positions.  The commands
  630. `m <', `m >' and `m .' not only set mark but also add it as the latest
  631. element of the mark ring (replacing the oldest one).  By repeating the
  632. command ``m ,'' you can visit older and older marked positions.  You
  633. will eventually be in a loop as the mark ring is a ring.
  634. File: vip,  Node: Motion Commands,  Next: Searching and Replacing,  Prev: Mark Commands,  Up: Vi Commands
  635. Motion Commands
  636. ===============
  637.    Commands for moving around in the current buffer are collected here.
  638. These commands are used as an `argument' for the delete, change and
  639. yank commands to be described in the next section.
  640.      Move point backward by one character.  Signal error if point is at
  641.      the beginning of buffer, but (unlike Vi) do not complain otherwise
  642.      (`vip-backward-char').
  643.      Move point backward by one character.  Signal error if point is at
  644.      the end of buffer, but (unlike Vi) do not complain otherwise
  645.      (`vip-forward-char').
  646.      Move point to the next line keeping the current column.  If point
  647.      is on the last line of the buffer, a new line will be created and
  648.      point will move to that line (`vip-next-line').
  649.      Move point to the previous line keeping the current column
  650.      (`vip-next-line').
  651.      Move point to the next line at the first non-white character.  If
  652.      point is on the last line of the buffer, a new line will be
  653.      created and point will move to the beginning of that line
  654.      (`vip-next-line-at-bol').
  655.      Move point to the previous line at the first non-white character
  656.      (`vip-previous-line-at-bol').
  657. If a count is given to these commands, the commands will be repeated
  658. that many times.
  659.      Move point to the beginning of line (`vip-beginning-of-line').
  660.      Move point to the first non-white character on the line
  661.      (`vip-bol-and-skip-white').
  662.      Move point to the end of line (`vip-goto-eol').
  663. `N |'
  664.      Move point to the N-th column on the line (`vip-goto-col').
  665. Except for the `|' command, these commands neglect a count.
  666.      Move point forward to the beginning of the next word
  667.      (`vip-forward-word').
  668.      Move point forward to the beginning of the next word, where a
  669.      "word" is considered as a sequence of non-white characters
  670.      (`vip-forward-Word').
  671.      Move point backward to the beginning of a word
  672.      (`vip-backward-word').
  673.      Move point backward to the beginning of a word, where a word is
  674.      considered as a sequence of non-white characters
  675.      (`vip-forward-Word').
  676.      Move point forward to the end of a word (`vip-end-of-word').
  677.      Move point forward to the end of a word, where a word is
  678.      considered as a sequence of non-white characters
  679.      (`vip-end-of-Word').
  680. Here the meaning of the word `word' for the `w', `b' and `e' commands
  681. is determined by the "syntax table" effective in the current buffer.
  682. Each major mode has its syntax mode, and therefore the meaning of a
  683. word also changes as the major mode changes.  See GNU Emacs Manual for
  684. details of syntax table.
  685.      Move point to the beginning of the home (top) line of the window.
  686.      Given a count N, go to the N-th line from top (`vip-window-top').
  687.      Move point to the beginning of the middle line of the window.
  688.      Given a count N, go to the N-th line from the middle line
  689.      (`vip-window-middle').
  690.      Move point to the beginning of the lowest (bottom) line of the
  691.      window.  Given count, go to the N-th line from bottom
  692.      (`vip-window-bottom').
  693. These commands can be used to go to the desired line visible on the
  694. screen.
  695.      Move point backward to the beginning of the sentence
  696.      (`vip-backward-sentence').
  697.      Move point forward to the end of the sentence
  698.      (`vip-forward-sentence').
  699.      Move point backward to the beginning of the paragraph
  700.      (`vip-backward-paragraph').
  701.      Move point forward to the end of the paragraph
  702.      (`vip-forward-paragraph').
  703. A count repeats the effect for these commands.
  704.      Given a count N, move point to the N-th line in the buffer on the
  705.      first non-white character.  Without a count, go to the end of the
  706.      buffer (`vip-goto-line').
  707. `` `'
  708.      Exchange point and mark (`vip-goto-mark').
  709. `` CH'
  710.      Move point to the position stored in the register CH.  CH must be
  711.      a lower case letter.
  712. `' ''
  713.      Exchange point and mark, and then move point to the first non-white
  714.      character on the line (`vip-goto-mark-and-skip-white').
  715. `' CH'
  716.      Move point to the position stored in the register CH and skip to
  717.      the first non-white character on the line.  CH must be a lower
  718.      case letter.
  719.      Move point to the matching parenthesis if point is looking at `(',
  720.      `)', `{', `}', `[' or `]'
  721.      (`vip-paren-match').
  722. The command `G' mark point before move, so that you can return to the
  723. original point by `` `'.  The original point will also be stored in the
  724. mark ring.
  725.    The following commands are useful for moving points on the line.  A
  726. count will repeat the effect.
  727. `f CH'
  728.      Move point forward to the character CH on the line.  Signal error
  729.      if CH could not be found (`vip-find-char-forward').
  730. `F CH'
  731.      Move point backward to the character CH on the line.  Signal error
  732.      if CH could not be found (`vip-find-char-backward').
  733. `t CH'
  734.      Move point forward upto the character CH on the line.  Signal
  735.      error if CH could not be found (`vip-goto-char-forward').
  736. `T CH'
  737.      Move point backward upto the character CH on the line.  Signal
  738.      error if CH could not be found (`vip-goto-char-backward').
  739.      Repeat previous `f', `t', `F' or `T' command (`vip-repeat-find').
  740.      Repeat previous `f', `t', `F' or `T' command, in the opposite
  741.      direction (`vip-repeat-find-opposite').
  742. File: vip,  Node: Searching and Replacing,  Next: Modifying Commands,  Prev: Motion Commands,  Up: Vi Commands
  743. Searching and Replacing
  744. =======================
  745.    Following commands are available for searching and replacing.
  746. `/ STRING RET'
  747.      Search the first occurrence of the string STRING forward starting
  748.      from point.  Given a count N, the N-th occurrence of STRING will
  749.      be searched.  If the variable `vip-re-search' has value `t' then
  750.      "regular expression" search is done and the string matching the
  751.      regular expression STRING is found.  If you give an empty string
  752.      as STRING then the search mode will change from vanilla search to
  753.      regular expression search and vice versa (`vip-search-forward').
  754. `? STRING RET'
  755.      Same as `/', except that search is done backward
  756.      (`vip-search-backward').
  757.      Search the previous search pattern in the same direction as before
  758.      (`vip-search-next').
  759.      Search the previous search pattern in the opposite direction
  760.      (`vip-search-Next').
  761. `C-s'
  762.      Search forward incrementally.  See GNU Emacs Manual for details
  763.      (`isearch-forward').
  764. `C-r'
  765.      Search backward incrementally (`isearch-backward').
  766. `R STRING RET NEWSTRING'
  767.      There are two modes of replacement, "vanilla" and "regular
  768.      expression".  If the mode is vanilla you will get a prompt
  769.      `Replace string:', and if the mode is regular expression you will
  770.      ge a prompt `Replace regexp:'.  The mode is initially vanilla, but
  771.      you can toggle these modes by giving a null string as STRING.  If
  772.      the mode is vanilla, this command replaces every occurrence of
  773.      STRING with NEWSTRING.  If the mode is regular expression, STRING
  774.      is treated as a regular expression and every string matching the
  775.      regular expression is replaced with NEWSTRING
  776.      (`vip-replace-string').
  777. `Q    STRING RET NEWSTRING'
  778.      Same as `R' except that you will be asked form confirmation before
  779.      each replacement
  780.      (`vip-query-replace').
  781. `r CH'
  782.      Replace the character point is looking at by the character CH.
  783.      Give count, replace that many characters by CH
  784.      (`vip-replace-char').
  785. The commands `/' and `?' mark point before move, so that you can return
  786. to the original point by `` `'.
  787. File: vip,  Node: Modifying Commands,  Next: Delete Commands,  Prev: Searching and Replacing,  Up: Vi Commands
  788. Modifying Commands
  789. ==================
  790.    In this section, commands for modifying the content of a buffer are
  791. described.  These commands affect the region determined by a motion
  792. command which is given to the commands as their argument.
  793.    We classify motion commands into "point commands" and "line
  794. commands".  The point commands are as follows:
  795.      `h', `l', `0', `^', `$', `w', `W', `b', `B', `e', `E', `(', `)', `/', `?', ``', `f', `F', `t', `T', `%', `;', `,'
  796. The line commands are as follows:
  797.      `j', `k', `+', `-', `H', `M', `L', `{', `}', `G', `''
  798. If a point command is given as an argument to a modifying command, the
  799. region determined by the point command will be affected by the modifying
  800. command. On the other hand, if a line command is given as an argument
  801. to a modifying command, the region determined by the line command will
  802. be enlarged so that it will become the smallest region properly
  803. containing the region and consisting of whole lines (we call this
  804. process "expanding the region"), and then the enlarged region will be
  805. affected by the modifying command.
  806. * Menu:
  807. * Delete Commands::    Commands for deleting text.
  808. * Yank Commands::    Commands for yanking text in Vi's sense.
  809. * Put Back Commands::    Commands for putting back deleted/yanked text.
  810. * Change Commands::    Commands for changing text.
  811. * Repeating and Undoing Modifications::
  812. File: vip,  Node: Delete Commands,  Next: Yank Commands,  Prev: Modifying Commands,  Up: Modifying Commands
  813. Delete Commands
  814. ---------------
  815. `d MOTION-COMMAND'
  816.      Delete the region determined by the motion command MOTION-COMMAND.
  817. For example, `d $' will delete the region between point and end of
  818. current line since `$' is a point command that moves point to end of
  819. line.  `d G' will delete the region between the beginning of current
  820. line and end of the buffer, since `G' is a line command.  A count given
  821. to the command above will become the count for the associated motion
  822. command.  Thus, `3 d w' will delete three words.
  823.    It is also possible to save the deleted text into a register you
  824. specify.  For example, you can say `" t 3 d w' to delete three words
  825. and save it to register `t'.  The name of a register is a lower case
  826. letter between `a' and `z'.  If you give an upper case letter as an
  827. argument to a delete command, then the deleted text will be appended to
  828. the content of the register having the corresponding lower case letter
  829. as its name.  So, `" T d w' will delete a word and append it to
  830. register `t'.  Other modifying commands also accept a register name as
  831. their argument, and we will not repeat similar explanations.
  832.    We have more delete commands as below.
  833. `d d'
  834.      Delete a line.  Given a count N, delete N lines.
  835. `d r'
  836.      Delete current region.
  837. `d R'
  838.      Expand current region and delete it.
  839.      Delete to the end of a line (`vip-kill-line').
  840.      Delete a character after point.  Given N, delete N characters
  841.      (`vip-delete-char').
  842. `DEL'
  843.      Delete a character before point.  Given N, delete N characters
  844.      (`vip-delete-backward-char').
  845. File: vip,  Node: Yank Commands,  Next: Put Back Commands,  Prev: Delete Commands,  Up: Modifying Commands
  846. Yank Commands
  847. -------------
  848.    Yank commands "yank" a text of buffer into a (usually anonymous)
  849. register.  Here the word `yank' is used in Vi's sense.  Thus yank
  850. commands do not alter the content of the buffer, and useful only in
  851. combination with commands that put back the yanked text into the buffer.
  852. `y MOTION-COMMAND'
  853.      Yank the region determined by the motion command MOTION-COMMAND.
  854. For example, `y $' will yank the text between point and the end of line
  855. into an anonymous register, while `"c y $' will yank the same text into
  856. register `c'.
  857.    Use the following command to yank consecutive lines of text.
  858. `y y'
  859.      Yank a line.  Given N, yank N lines (`vip-yank-line').
  860. `y r'
  861.      Yank current region.
  862. `y R'
  863.      Expand current region and yank it.
  864. File: vip,  Node: Put Back Commands,  Next: Change Commands,  Prev: Yank Commands,  Up: Modifying Commands
  865. Put Back Commands
  866. -----------------
  867.    Deleted or yanked texts can be put back into the buffer by the
  868. command below.
  869.      Insert, after the character point is looking at, most recently
  870.      deleted/yanked text from anonymous register. Given a register name
  871.      argument, the content of the named register will be put back.
  872.      Given a count, the command will be repeated that many times. This
  873.      command also checks if the text to put back ends with a new line
  874.      character, and if so the text will be put below the current line
  875.      (`vip-put-back').
  876.      Insert at point most recently deleted/yanked text from anonymous
  877.      register.  Given a register name argument, the content of the
  878.      named register will be put back.  Given a count, the command will
  879.      be repeated that many times.  This command also checks if the text
  880.      to put back ends with a new line character, and if so the text
  881.      will be put above the current line rather than at point
  882.      (`vip-Put-back').
  883. Thus, `" c p' will put back the content of the register `c' into the
  884. buffer.  It is also possible to specify "number register" which is a
  885. numeral between `1' and `9'.  If the number register N is specified,
  886. N-th previously deleted/yanked text will be put back.  It is an error
  887. to specify a number register for the delete/yank commands.
  888. File: vip,  Node: Change Commands,  Next: Repeating and Undoing Modifications,  Prev: Put Back Commands,  Up: Modifying Commands
  889. Change Commands
  890. ---------------
  891.    Most commonly used change command takes the following form.
  892. `c MOTION-COMMAND'
  893.      Replace the content of the region determined by the motion command
  894.      MOTION-COMMAND by the text you type.  If the motion command is a
  895.      point command then you will type the text into minibuffer, and if
  896.      the motion command is a line command then the region will be
  897.      deleted first and you can insert the text in INSERT MODE.
  898. For example, if point is at the beginning of a word `foo' and you wish
  899. to change it to `bar', you can type `c w'.  Then, as `w' is a point
  900. command, you will get the prompt `foo =>' in the minibuffer, for which
  901. you can type `b a r RET' to complete the change command.
  902. `c c'
  903.      Change a line.  Given a count, that many lines are changed.
  904. `c r'
  905.      Change current region.
  906. `c R'
  907.      Expand current region and change it.
  908. File: vip,  Node: Repeating and Undoing Modifications,  Next: Other Vi Commands,  Prev: Change Commands,  Up: Modifying Commands
  909. Repeating and Undoing Modifications
  910. -----------------------------------
  911.    VIP records the previous modifying command, so that it is easy to
  912. repeat it.  It is also very easy to undo changes made by modifying
  913. commands.
  914.      Undo the last change.  You can undo more by repeating undo by the
  915.      repeat command `.'.  For example, you can undo 5 previous changes
  916.      by typing `u....'.  If you type `uu', then the second `u' undoes
  917.      the first undo command (`vip-undo').
  918.      Repeat the last modifying command.  Given count N it becomes the
  919.      new count for the repeated command.  Otherwise, the count for the
  920.      last modifying command is used again (`vip-repeat').
  921. File: vip,  Node: Other Vi Commands,  Next: Commands in Insert Mode,  Prev: Repeating and Undoing Modifications,  Up: Vi Commands
  922. Other Vi Commands
  923. =================
  924.    Miscellaneous Vi commands are collected here.
  925. `Z Z'
  926.      Exit Emacs.  If modified buffers exist, you will be asked whether
  927.      you wish to save them or not (`save-buffers-kill-emacs').
  928. `! MOTION-COMMAND FORMAT-COMMAND'
  929. `N ! ! FORMAT-COMMAND'
  930.      The region determined by the motion command MOTION-COMMAND will be
  931.      given to the shell command FORMAT-COMMAND and the region will be
  932.      replaced by its output.  If a count is given, it will be passed to
  933.      MOTION-COMMAND.  For example, `3!Gsort' will sort the region
  934.      between point and the 3rd line.  If `!' is used instead of
  935.      MOTION-COMMAND then N lines will be processed by FORMAT-COMMAND
  936.      (`vip-command-argument').
  937.      Join two lines.  Given count, join that many lines.  A space will
  938.      be inserted at each junction (`vip-join-lines').
  939. `< MOTION-COMMAND'
  940. `N < <'
  941.      Shift region determined by the motion command MOTION-COMMAND to
  942.      left by SHIFT-WIDTH (default is 8).  If `<' is used instead of
  943.      MOTION-COMMAND then shift N lines
  944.      (`vip-command-argument').
  945. `> MOTION-COMMAND'
  946. `N > >'
  947.      Shift region determined by the motion command MOTION-COMMAND to
  948.      right by SHIFT-WIDTH (default is 8).  If `<' is used instead of
  949.      MOTION-COMMAND then shift N lines
  950.      (`vip-command-argument').
  951. `= MOTION-COMMAND'
  952.      Indent region determined by the motion command MOTION-COMMAND.  If
  953.      `=' is used instead of MOTION-COMMAND then indent N lines
  954.      (`vip-command-argument').
  955.      Call last remembered keyboard macro.
  956.      A new vi operator. *Note New Commands::, for more details.
  957.    The following keys are reserved for future extensions, and currently
  958. assigned to a function that just beeps (`vip-nil').
  959.      &, @, U, [, ], _, q, ~
  960.    VIP uses a special local keymap to interpret key strokes you enter
  961. in vi mode.  The following keys are bound to NIL in the keymap.
  962. Therefore, these keys are interpreted by the global keymap of Emacs.
  963. We give below a short description of the functions bound to these keys
  964. in the global keymap.  See GNU Emacs Manual for details.
  965. `C-@'
  966.      Set mark and push previous mark on mark ring (`set-mark-command').
  967. `TAB'
  968.      Indent line for current major mode (`indent-for-tab-command').
  969. `LFD'
  970.      Insert a newline, then indent according to mode
  971.      (`newline-and-indent').
  972. `C-k'
  973.      Kill the rest of the current line; before a newline, kill the
  974.      newline.  With prefix argument, kill that many lines from point.
  975.      Negative arguments kill lines backward (`kill-line').
  976. `C-l'
  977.      Clear the screen and reprint everything (`recenter').
  978. `N C-p'
  979.      Move cursor vertically up N lines (`previous-line').
  980. `C-q'
  981.      Read next input character and insert it.  Useful for inserting
  982.      control characters
  983.      (`quoted-insert').
  984. `C-r'
  985.      Search backward incrementally (`isearch-backward').
  986. `C-s'
  987.      Search forward incrementally (`isearch-forward').
  988. `N C-t'
  989.      Interchange characters around point, moving forward one character.
  990.      With count N, take character before point and drag it forward
  991.      past N other characters.  If no argument and at end of line, the
  992.      previous two characters are exchanged (`transpose-chars').
  993. `N C-v'
  994.      Scroll text upward N lines.  If N is not given, scroll near full
  995.      screen (`scroll-up').
  996. `C-w'
  997.      Kill between point and mark.  The text is save in the kill ring.
  998.      The command `P' or `p' can retrieve it from kill ring
  999.      (`kill-region').
  1000.